home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source, ISO-8859 text
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2c | 63 6f 6d 70 2e 6c 61 6e |.lang.c,|comp.lan|
|00000020| 67 2e 63 2b 2b 0a 50 61 | 74 68 3a 20 61 72 74 65 |g.c++.Pa|th: arte|
|00000030| 6d 69 73 2e 73 74 6f 2e | 66 64 61 74 61 2e 73 65 |mis.sto.|fdata.se|
|00000040| 21 6e 65 77 73 0a 46 72 | 6f 6d 3a 20 4e 69 6b 6c |!news.Fr|om: Nikl|
|00000050| 61 73 20 4d 65 6c 6c 69 | 6e 20 3c 6e 69 6b 6c 61 |as Melli|n <nikla|
|00000060| 73 2e 6d 65 6c 6c 69 6e | 40 73 74 6f 2e 66 64 61 |s.mellin|@sto.fda|
|00000070| 74 61 2e 73 65 3e 0a 53 | 75 62 6a 65 63 74 3a 20 |ta.se>.S|ubject: |
|00000080| 52 65 3a 20 73 69 7a 65 | 6f 66 28 29 20 71 75 65 |Re: size|of() que|
|00000090| 73 74 69 6f 6e 20 3e 3e | 3e 20 3a 29 0a 53 65 6e |stion >>|> :).Sen|
|000000a0| 64 65 72 3a 20 6e 65 77 | 73 40 61 72 74 65 6d 69 |der: new|s@artemi|
|000000b0| 73 2e 73 74 6f 2e 66 64 | 61 74 61 2e 73 65 20 28 |s.sto.fd|ata.se (|
|000000c0| 55 73 65 4e 65 74 20 4e | 65 74 4e 65 77 73 29 0a |UseNet N|etNews).|
|000000d0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 33 31 36 |Message-|ID: <316|
|000000e0| 45 33 35 44 36 2e 31 39 | 42 39 40 73 74 6f 2e 66 |E35D6.19|B9@sto.f|
|000000f0| 64 61 74 61 2e 73 65 3e | 0a 44 61 74 65 3a 20 46 |data.se>|.Date: F|
|00000100| 72 69 2c 20 31 32 20 41 | 70 72 20 31 39 39 36 20 |ri, 12 A|pr 1996 |
|00000110| 31 30 3a 35 32 3a 30 36 | 20 47 4d 54 0a 54 6f 3a |10:52:06| GMT.To:|
|00000120| 20 6e 61 64 65 72 72 40 | 74 6f 70 61 7a 2e 63 71 | naderr@|topaz.cq|
|00000130| 75 2e 65 64 75 2e 61 75 | 0a 43 6f 6e 74 65 6e 74 |u.edu.au|.Content|
|00000140| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000150| 6e 67 3a 20 37 62 69 74 | 0a 43 6f 6e 74 65 6e 74 |ng: 7bit|.Content|
|00000160| 2d 54 79 70 65 3a 20 74 | 65 78 74 2f 70 6c 61 69 |-Type: t|ext/plai|
|00000170| 6e 3b 20 63 68 61 72 73 | 65 74 3d 75 73 2d 61 73 |n; chars|et=us-as|
|00000180| 63 69 69 0a 52 65 66 65 | 72 65 6e 63 65 73 3a 20 |cii.Refe|rences: |
|00000190| 3c 31 39 39 36 41 70 72 | 31 32 2e 30 36 31 39 32 |<1996Apr|12.06192|
|000001a0| 37 40 74 6f 70 61 7a 3e | 0a 4d 69 6d 65 2d 56 65 |7@topaz>|.Mime-Ve|
|000001b0| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 58 2d 4d 61 69 |rsion: 1|.0.X-Mai|
|000001c0| 6c 65 72 3a 20 4d 6f 7a | 69 6c 6c 61 20 32 2e 30 |ler: Moz|illa 2.0|
|000001d0| 20 28 57 69 6e 4e 54 3b | 20 49 29 0a 4f 72 67 61 | (WinNT;| I).Orga|
|000001e0| 6e 69 7a 61 74 69 6f 6e | 3a 20 57 4d 2d 64 61 74 |nization|: WM-dat|
|000001f0| 61 20 46 f6 72 73 76 61 | 72 73 64 61 74 61 20 41 |a F.rsva|rsdata A|
|00000200| 42 2c 20 53 77 65 64 65 | 6e 0a 0a 6e 61 64 65 72 |B, Swede|n..nader|
|00000210| 72 40 74 6f 70 61 7a 2e | 63 71 75 2e 65 64 75 2e |r@topaz.|cqu.edu.|
|00000220| 61 75 20 77 72 6f 74 65 | 3a 0a 3e 20 0a 3e 20 48 |au wrote|:.> .> H|
|00000230| 69 2c 0a 3e 20 0a 3e 20 | 48 6f 77 20 63 61 6e 20 |i,.> .> |How can |
|00000240| 49 20 67 65 74 2c 20 77 | 69 74 68 20 61 20 70 6f |I get, w|ith a po|
|00000250| 69 6e 74 65 72 2c 20 20 | 74 68 65 20 73 69 7a 65 |inter, |the size|
|00000260| 6f 66 20 20 6f 66 20 61 | 6e 20 20 61 72 72 61 79 |of of a|n array|
|00000270| 20 74 68 61 74 20 69 73 | 0a 3e 20 70 6f 69 6e 74 | that is|.> point|
|00000280| 65 64 20 62 79 20 74 68 | 65 20 70 6f 69 6e 74 65 |ed by th|e pointe|
|00000290| 72 20 3f 20 20 28 4e 6f | 20 69 74 27 73 20 6e 6f |r ? (No| it's no|
|000002a0| 74 20 61 20 74 6f 75 6e | 67 65 20 74 77 69 73 74 |t a toun|ge twist|
|000002b0| 65 72 20 3a 29 0a 0a 5b | 45 78 61 6d 70 6c 65 20 |er :)..[|Example |
|000002c0| 64 65 6c 65 74 65 64 5d | 0a 0a 43 20 61 6e 64 20 |deleted]|..C and |
|000002d0| 43 2b 2b 20 68 61 73 20 | 6e 6f 20 64 69 72 65 63 |C++ has |no direc|
|000002e0| 74 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 72 61 |t suppor|t for ra|
|000002f0| 6e 67 65 20 63 68 65 63 | 6b 69 6e 67 20 6f 72 20 |nge chec|king or |
|00000300| 73 69 7a 65 20 69 6e 71 | 75 65 72 69 6e 67 20 0a |size inq|uering .|
|00000310| 6f 66 20 61 6e 20 61 72 | 72 61 79 2e 20 54 68 69 |of an ar|ray. Thi|
|00000320| 73 20 61 73 70 65 63 74 | 20 6f 66 20 74 68 65 73 |s aspect| of thes|
|00000330| 65 20 6c 61 6e 67 75 61 | 67 65 73 20 69 73 20 6f |e langua|ges is o|
|00000340| 66 74 65 6e 20 73 65 72 | 69 6f 75 73 6c 79 20 0a |ften ser|iously .|
|00000350| 63 72 69 74 69 73 69 73 | 65 64 20 62 79 20 6e 6f |critisis|ed by no|
|00000360| 6e 20 43 2b 2b 20 70 72 | 6f 67 72 61 6d 65 72 73 |n C++ pr|ogramers|
|00000370| 20 28 61 6e 64 20 73 6f | 6d 65 20 43 2b 2b 20 70 | (and so|me C++ p|
|00000380| 72 6f 67 72 61 6d 6d 65 | 72 73 29 2e 20 54 68 69 |rogramme|rs). Thi|
|00000390| 73 20 69 73 20 0a 6e 6f | 20 62 69 67 20 64 65 61 |s is .no| big dea|
|000003a0| 6c 20 74 68 6f 75 67 68 | 2c 20 62 65 63 61 75 73 |l though|, becaus|
|000003b0| 65 20 69 74 20 69 73 20 | 65 61 73 79 20 74 6f 20 |e it is |easy to |
|000003c0| 77 72 69 74 65 20 79 6f | 75 72 20 6f 77 6e 20 73 |write yo|ur own s|
|000003d0| 61 66 65 20 61 72 72 61 | 79 20 0a 63 6c 61 73 73 |afe arra|y .class|
|000003e0| 65 73 2c 20 6f 72 20 74 | 6f 20 75 73 65 20 53 54 |es, or t|o use ST|
|000003f0| 4c 20 74 68 61 74 20 69 | 73 20 69 6e 63 6c 75 64 |L that i|s includ|
|00000400| 65 64 20 69 6e 20 74 68 | 65 20 64 72 61 66 74 20 |ed in th|e draft |
|00000410| 73 74 61 6e 64 61 72 64 | 2e 0a 0a 53 54 4c 20 64 |standard|...STL d|
|00000420| 6f 65 73 6e 27 74 20 70 | 72 6f 74 65 63 74 20 79 |oesn't p|rotect y|
|00000430| 6f 75 20 66 72 6f 6d 20 | 77 72 69 74 69 6e 67 20 |ou from |writing |
|00000440| 6f 75 74 73 69 64 65 20 | 61 6e 20 61 72 72 61 79 |outside |an array|
|00000450| 2c 20 62 75 74 20 79 6f | 75 20 63 61 6e 0a 61 73 |, but yo|u can.as|
|00000460| 6b 20 61 62 6f 75 74 20 | 74 68 65 20 73 69 7a 65 |k about |the size|
|00000470| 20 6f 66 20 61 6e 20 61 | 72 72 61 79 20 61 6e 79 | of an a|rray any|
|00000480| 20 74 69 6d 65 2e 0a 0a | 23 69 6e 63 6c 75 64 65 | time...|#include|
|00000490| 20 3c 76 65 63 74 6f 72 | 3e 0a 23 69 6e 63 6c 75 | <vector|>.#inclu|
|000004a0| 64 65 20 3c 69 6f 73 74 | 72 65 61 6d 3e 20 2f 2f |de <iost|ream> //|
|000004b0| 20 6f 72 20 77 68 61 74 | 65 76 65 72 20 74 68 69 | or what|ever thi|
|000004c0| 73 20 68 65 61 64 65 72 | 20 69 73 20 69 6e 20 74 |s header| is in t|
|000004d0| 68 65 20 64 72 61 66 74 | 20 73 74 61 6e 64 61 72 |he draft| standar|
|000004e0| 64 0a 23 69 6e 63 6c 75 | 64 65 20 22 66 6f 6f 2e |d.#inclu|de "foo.|
|000004f0| 68 22 0a 0a 76 65 63 74 | 6f 72 3c 66 6f 6f 3e 20 |h"..vect|or<foo> |
|00000500| 66 6f 6f 56 65 63 74 6f | 72 3b 0a 0a 76 6f 69 64 |fooVecto|r;..void|
|00000510| 20 66 28 29 0a 7b 0a 20 | 20 66 6f 72 20 28 69 6e | f().{. | for (in|
|00000520| 74 20 69 20 3d 20 30 3b | 20 69 20 3c 20 66 6f 6f |t i = 0;| i < foo|
|00000530| 56 65 63 74 6f 72 2e 73 | 69 7a 65 28 29 3b 20 2b |Vector.s|ize(); +|
|00000540| 2b 69 29 0a 2f 2f 20 20 | 20 20 20 20 20 20 20 20 |+i).// | |
|00000550| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000560| 20 20 20 5e 5e 5e 5e 5e | 5e 5e 0a 20 20 7b 0a 20 | ^^^^^|^^. {. |
|00000570| 20 20 20 63 6f 75 74 20 | 3c 3c 20 66 6f 6f 56 65 | cout |<< fooVe|
|00000580| 63 74 6f 72 5b 69 5d 2e | 56 61 6c 75 65 28 29 20 |ctor[i].|Value() |
|00000590| 3c 3c 20 65 6e 64 6c 3b | 20 2f 2f 20 56 61 6c 75 |<< endl;| // Valu|
|000005a0| 65 20 69 73 20 6d 65 6d | 62 65 72 66 75 6e 63 74 |e is mem|berfunct|
|000005b0| 69 6f 6e 20 6f 66 20 66 | 6f 6f 0a 20 20 7d 0a 7d |ion of f|oo. }.}|
|000005c0| 0a 0a 3e 20 66 6f 72 20 | 58 58 58 58 58 58 58 20 |..> for |XXXXXXX |
|000005d0| 74 68 65 20 5f 6f 6e 6c | 79 5f 20 74 68 69 6e 67 |the _onl|y_ thing|
|000005e0| 20 74 68 61 74 20 49 20 | 63 61 6e 20 66 69 6e 64 | that I |can find|
|000005f0| 20 74 68 61 74 20 77 6f | 72 6b 73 20 69 73 20 74 | that wo|rks is t|
|00000600| 6f 20 73 74 69 63 6b 0a | 3e 20 69 6e 20 74 68 65 |o stick.|> in the|
|00000610| 72 65 20 69 73 20 74 68 | 65 20 61 63 74 75 61 6c |re is th|e actual|
|00000620| 20 61 72 72 61 79 20 74 | 68 61 74 20 63 70 20 69 | array t|hat cp i|
|00000630| 73 20 70 6f 69 6e 74 69 | 6e 67 20 74 6f 2c 20 69 |s pointi|ng to, i|
|00000640| 2e 65 2e 20 73 69 7a 65 | 6f 66 28 46 69 72 73 74 |.e. size|of(First|
|00000650| 5f 6e 61 6d 65 29 2e 0a | 0a 49 74 20 69 73 20 74 |_name)..|.It is t|
|00000660| 68 65 20 6f 6e 6c 79 20 | 74 68 69 6e 67 2e 0a 20 |he only |thing.. |
|00000670| 0a 3e 20 57 68 61 74 20 | 69 64 65 61 73 20 64 6f |.> What |ideas do|
|00000680| 20 79 6f 75 20 68 61 76 | 65 20 73 6f 20 74 68 61 | you hav|e so tha|
|00000690| 74 20 49 20 63 61 6e 20 | 67 65 74 20 74 68 65 20 |t I can |get the |
|000006a0| 73 69 7a 65 20 6f 66 20 | 74 68 65 20 61 72 72 61 |size of |the arra|
|000006b0| 79 20 63 75 72 72 65 6e | 74 6c 79 0a 3e 20 70 6f |y curren|tly.> po|
|000006c0| 69 6e 74 65 64 20 74 6f | 20 62 79 20 63 70 3f 0a |inted to| by cp?.|
|000006d0| 0a 57 72 69 74 65 20 79 | 6f 75 72 20 6f 77 6e 20 |.Write y|our own |
|000006e0| 63 6f 6e 74 61 69 6e 65 | 72 20 63 6c 61 73 73 20 |containe|r class |
|000006f0| 6f 72 20 75 73 65 20 6f | 6e 65 20 74 68 61 74 20 |or use o|ne that |
|00000700| 73 6f 6d 65 6f 6e 65 20 | 65 6c 73 65 20 68 61 73 |someone |else has|
|00000710| 20 6d 61 64 65 20 66 6f | 72 0a 79 6f 75 20 28 6c | made fo|r.you (l|
|00000720| 69 6b 65 20 53 54 4c 29 | 2e 0a 0a 2d 2d 2d 0a 4e |ike STL)|...---.N|
|00000730| 69 6b 6c 61 73 20 4d 65 | 6c 6c 69 6e 0a |iklas Me|llin. |
+--------+-------------------------+-------------------------+--------+--------+